Update to new Pango APIs
authorAlex Larsson <alexl@redhat.com>
Wed, 24 Oct 2001 23:41:12 +0000 (23:41 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Wed, 24 Oct 2001 23:41:12 +0000 (23:41 +0000)
2001-10-24  Alex Larsson  <alexl@redhat.com>

* gdk/linux-fb/gdkfont-fb.c:
Update to new Pango APIs

* gdk/linux-fb/gdkproperty-fb.c:
Update to new GdkAtom APIs

* gdk/linux-fb/gdkwindow-fb.c:
Remove warnings

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/linux-fb/gdkfont-fb.c
gdk/linux-fb/gdkproperty-fb.c
gdk/linux-fb/gdkwindow-fb.c

index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 459ff0741d3c2e6d25e8bdf9a95fade85aebdcd2..8f61412429d1e5a40803cddf677abc5e8ae5e226 100644 (file)
@@ -1,3 +1,14 @@
+2001-10-24  Alex Larsson  <alexl@redhat.com>
+
+       * gdk/linux-fb/gdkfont-fb.c:
+       Update to new Pango APIs
+
+       * gdk/linux-fb/gdkproperty-fb.c:
+       Update to new GdkAtom APIs
+
+       * gdk/linux-fb/gdkwindow-fb.c:
+       Remove warnings
+
 Mon Oct 22 20:07:21 2001  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreestore.c (gtk_tree_store_prepend): Fix docs, #62808
index 82b2db7c62ad5d429c4d5d4c656d56ee0a081653..2ae5354ddf93fe0c4fd65b5d209d8f834987b958 100644 (file)
@@ -142,12 +142,12 @@ gdk_font_from_description (PangoFontDescription *desc)
   g_free (lang);
   g_object_unref (G_OBJECT (context));
 
-  font->ascent = PANGO_PIXELS (metrics->ascent);
-  font->descent = PANGO_PIXELS (metrics->descent);
+  font->ascent = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics));
+  font->descent = PANGO_PIXELS (pango_font_metrics_get_descent (metrics));
 
   g_assert ((font->ascent > 0) || (font->descent > 0));
 
-  pango_metrics_unref (metrics);
+  pango_font_metrics_unref (metrics);
   
   return font;
 }
@@ -158,7 +158,7 @@ gdk_font_load (const gchar *font_name)
 {
   GdkFont *font;
   GdkFontPrivateFB *private;
-  PangoFontDescription desc;
+  PangoFontDescription *desc;
   gchar **pieces;
 
   g_return_val_if_fail (font_name != NULL, NULL);
@@ -167,14 +167,7 @@ gdk_font_load (const gchar *font_name)
   if (font)
     return font;
 
-  /* Default values */
-  desc.family_name = NULL;
-  desc.style = PANGO_STYLE_NORMAL;
-  desc.weight = PANGO_WEIGHT_NORMAL;
-  desc.variant = PANGO_VARIANT_NORMAL;
-  desc.stretch = PANGO_STRETCH_NORMAL;
-  
-  desc.size = 0;
+  desc = pango_font_description_new ();
   
   pieces = g_strsplit (font_name, "-", 8);
 
@@ -189,27 +182,27 @@ gdk_font_load (const gchar *font_name)
       break;
 
     if (strcmp (pieces[2], "*")!=0)
-      desc.family_name = g_strdup (pieces[2]);
+      pango_font_description_set_family (desc, g_strdup (pieces[2]));
     
     if (!pieces[3])
       break;
     
     if (strcmp (pieces[3], "light")==0)
-      desc.weight = PANGO_WEIGHT_LIGHT;
+      pango_font_description_set_weight (desc, PANGO_WEIGHT_LIGHT);
     if (strcmp (pieces[3], "medium")==0)
-      desc.weight = PANGO_WEIGHT_NORMAL;
+      pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
     if (strcmp (pieces[3], "bold")==0)
-      desc.weight = PANGO_WEIGHT_BOLD;
+      pango_font_description_set_weight (desc, PANGO_WEIGHT_BOLD);
     
     if (!pieces[4])
       break;
     
     if (strcmp (pieces[4], "r")==0)
-      desc.style = PANGO_STYLE_NORMAL;
+      pango_font_description_set_style (desc, PANGO_STYLE_NORMAL);
     if (strcmp (pieces[4], "i")==0)
-      desc.style = PANGO_STYLE_ITALIC;
+      pango_font_description_set_style (desc, PANGO_STYLE_ITALIC);
     if (strcmp (pieces[4], "o")==0)
-      desc.style = PANGO_STYLE_OBLIQUE;
+      pango_font_description_set_style (desc, PANGO_STYLE_OBLIQUE);
     
     if (!pieces[5])
       break;
@@ -219,13 +212,13 @@ gdk_font_load (const gchar *font_name)
       break;
 
     if (strcmp (pieces[7], "*")!=0)
-      desc.size = atoi (pieces[7]) * PANGO_SCALE;
-    if (desc.size == 0)
-      desc.size = 12 * PANGO_SCALE;
+      pango_font_description_set_size  (desc, atoi (pieces[7]) * PANGO_SCALE);
+    if (pango_font_description_get_size (desc) == 0)
+      pango_font_description_set_size (desc, 12 * PANGO_SCALE);
     
   } while (0);
   
-  font = gdk_font_from_description (&desc);
+  font = gdk_font_from_description (desc);
   private = (GdkFontPrivateFB*) font;
   private->name = g_strdup (font_name);
 
@@ -233,7 +226,7 @@ gdk_font_load (const gchar *font_name)
 
   g_strfreev(pieces);
 
-  g_free (desc.family_name);
+  pango_font_description_free (desc);
   
   return font;
 }
index 38156e6ee77f0c8c30824e066c417e3a0778c8d1..2de5e9cfa0e90d466f980ffab2f810944228c2df 100644 (file)
@@ -67,7 +67,7 @@ gdk_atom_intern (const gchar *atom_name,
 gchar*
 gdk_atom_name (GdkAtom atom)
 {
-  if (atom < 256)
+  if (GPOINTER_TO_UINT (atom) < 256)
     {
       
       switch (GPOINTER_TO_UINT (atom))
@@ -89,7 +89,7 @@ gdk_atom_name (GdkAtom atom)
        }
     }
   else
-    return g_strdup (g_quark_to_string (atom - 256));
+    return g_strdup (g_quark_to_string (GPOINTER_TO_UINT (atom) - 256));
 }
 
 static void
index ce4a9c0095063e54bf09c10d68c7016d194d2047..afb22550c0e13bd95ede89c668d5efcf8ac19703 100644 (file)
@@ -2220,14 +2220,12 @@ void
 gdk_window_get_frame_extents (GdkWindow    *window,
                               GdkRectangle *rect)
 {
-  g_return_val_if_fail (window != NULL, 0);
+  g_return_if_fail (window != NULL);
   
   rect->x = GDK_DRAWABLE_IMPL_FBDATA (window)->abs_x;
   rect->y = GDK_DRAWABLE_IMPL_FBDATA (window)->abs_y;
   rect->width = GDK_DRAWABLE_IMPL_FBDATA (window)->width;
   rect->height = GDK_DRAWABLE_IMPL_FBDATA (window)->height;
-
-  return TRUE;
 }
 
 GdkWindow*